<!DOCTYPE HTML>
<html>
<head>
<#include "/adminPage/common.html"/>

</head>
<body class="layui-layout-body">
	<div class="layui-layout layui-layout-admin">

		<#include "/adminPage/header.html"/>
		<#include "/adminPage/menu.html"/>

		<div class="layui-body">
			<!-- 内容主体区域 -->
			<div style="padding: 15px">
				<fieldset class="layui-elem-field layui-field-title">
					<legend>svn服务管理</legend>
				</fieldset>

				<#if hasSvnserve>
				<div class="layui-form">
					<div class="layui-inline">
						<button type="button" id="start" style="display: none;" class="layui-btn layui-btn-sm" onclick="start()">启动svn服务</button>
					</div>
					<div class="layui-inline">
						<button type="button" id="stop" style="display: none;"  class="layui-btn layui-btn-sm layui-btn-danger" onclick="stop()">停止svn服务</button>
					</div>
					<div class="layui-inline">&nbsp;&nbsp;&nbsp;&nbsp;域名或ip:</div>
					<div class="layui-inline">
						<input type="text" class="layui-input" style="width: 170px; height: 30px;" id="host" value="${host}" placeholder="不填为当前域名或ip">
					</div>
					<div class="layui-inline">&nbsp;&nbsp;&nbsp;&nbsp;svn端口:</div>
					<div class="layui-inline">
						<input type="number" class="layui-input" style="width: 80px; height: 30px;" id="port" value="${port}">
					</div>
					<#if inDocker>
					<div class="layui-inline">&nbsp;&nbsp;&nbsp;&nbsp;访问协议:</div>
					<div class="layui-inline" style="width: 70px;">
						<select name="protocol" id="protocol"  >
							<option ${(protocol=='http')?string('selected','')}>http</option>
							<option ${(protocol=='svn')?string('selected','')}>svn</option>
						</select>
					</div>
					</#if>
					<div class="layui-inline">
						&nbsp;&nbsp;&nbsp;&nbsp;svn服务运行状态：
						<span id='status'> </span>
					</div>
				</div>
				</#if>
				
				
				

				<#if !hasSvnserve>
				<div style="color: gray; padding-left: 30px;">
					<h3>你还没有安装Subversion, 请先进行安装</h3>
					<br>
					<h3>Ubuntu: apt install subversion</h3>
					<br>
					<h3>Centos: yum install subversion</h3>
					<br>
					<h3>Windows: 下载链接 https://www.visualsvn.com/server/download/</h3>
				</div>
				</#if>

			</div>


			<div style="padding: 15px">
				<fieldset class="layui-elem-field layui-field-title">
					<legend>WebHook配置</legend>
				</fieldset>

				<div class="layui-form" style="width: 500px;">
					<div class="layui-form-item">
						<label class="layui-form-label"> 状态 </label>
						<div class="layui-input-block">
							<select name="open" id="open">
								<option value="false">关闭</option>
								<option value="true">开启</option>
							</select>
						</div>
					</div>


					<div class="layui-form-item">
						<label class="layui-form-label"> Url链接 </label>
						<div class="layui-input-block">
							<input type="text" name="url" id="url" class="layui-input">
						</div>
					</div>

					<div class="layui-form-item">
						<label class="layui-form-label"> 验证密码 </label>
						<div class="layui-input-block">
							<input type="text" name="password" id="password" class="layui-input">
						</div>
					</div>

					<div class="layui-form-item">
						<button type="button" class="layui-btn layui-btn-normal" style="margin-left: 150px;" onclick="save()">保存</button>
						<button type="button" class="layui-btn" onclick="readme()">说明</button>
					</div>
				</div>

			</div>
		</div>
	</div>

	<script src="${ctx}/js/adminPage/config/index.js?v=${jsrandom}" type="text/javascript"></script>
</body>


</html>